@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  --sidebar-width: 220px;
  font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: light dark;
  color: rgba(255, 255, 255, 0.87);
  background-color: #242424;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  --primary-color: #13C2C2;
  --secondary-color: #1890FF;
  --text-color: #333;
  --text-secondary: #666;
  --bg-color: #f5f5f5;
  --border-color: #e8e8e8;
  --shadow-base: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition-smooth: all 0.3s ease;
  --container-max-width: 1200px;
  --z-header: 100;
  --z-modal: 1000;
  --z-tooltip: 1100;
  --primary-gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));

  --primary-dark: #006064;
  --primary-light: #36cfc9;
  --accent-color: #fa541c;
  --dark-bg: #001529; /* 导航栏深色背景 */
  --darker-bg: #002140; /* 更深的蓝色 */
  --light-bg: #f8fafc; /* 浅色背景 */
  --text-light: #e2e8f0;
  --bg-light: #ffffff;
  --bg-dark: #001529;
  --bg-pattern: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2313c2c2' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  --header-height: 70px;
  --footer-bg: #001529;
  --footer-text: #fff;
  --footer-link: #ccc;
  --footer-hover: var(--primary-color);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.12);
  --shadow-hover: 0 15px 35px rgba(19, 194, 194, 0.15);
  --transition-base: all 0.3s ease;
  --transition-bounce: all 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  --transition-smooth: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-bounce: all 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  --radius-sm: 4px;
  --radius-base: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition-base: all 0.3s ease;
  --transition-smooth: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-bounce: all 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  --container-max-width: 1400px;
  --z-header: 10;
  --z-dropdown: 20;
  --z-modal: 30;
  --z-tooltip: 40;
}

a {
  font-weight: 500;
  color: #646cff;
  text-decoration: inherit;
}
a:hover {
  color: #535bf2;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow-x: hidden; /* 防止水平滚动条 */
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  color: var(--text-color);
  background-color: var(--bg-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
}

h1 {
  font-size: 3.2em;
  line-height: 1.1;
}

button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  background-color: #1a1a1a;
  cursor: pointer;
  transition: border-color 0.25s;
}
button:hover {
  border-color: #646cff;
}
button:focus,
button:focus-visible {
  outline: 4px auto -webkit-focus-ring-color;
}

.card {
  padding: 2em;
}

#app {
  width: 100%;
  min-height: 100%;
  margin: 0 auto;
  padding: 0;
  text-align: center;
}

@media (prefers-color-scheme: light) {
  :root {
    color: #213547;
    background-color: #ffffff;
  }
  a:hover {
    color: #747bff;
  }
  button {
    background-color: #f9f9f9;
  }
}

.app-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* 左侧导航栏 */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-width);
  background-color: #001529; /* 深色背景，与图片相符 */
  color: rgba(255, 255, 255, 0.85);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  overflow-y: auto; /* 内容过长时可滚动 */
}

/* 侧边栏Logo区域 */
.sidebar-logo {
  height: 64px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  background-color: #002140; /* 更深的蓝色 */
  overflow: hidden;
}

/* 侧边栏导航菜单 */
.sidebar-menu {
  border-right: none !important;
  background: transparent !important;
}

/* 侧边栏折叠状态 */
.sidebar.collapsed {
  width: 64px;
}

/* 内容区 */
.main-container {
  width: calc(100% - var(--sidebar-width));
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: all 0.3s ease;
  padding: 0;
  box-sizing: border-box;
}

/* 主容器在侧边栏折叠时的调整 */
.sidebar-collapse .main-container {
  width: calc(100% - 64px);
  margin-left: 64px;
}

/* 移动设备时的样式调整 */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .main-container {
    width: 100%;
    margin-left: 0;
  }
  
  .sidebar-collapse .main-container {
    width: 100%;
    margin-left: 0;
  }
  
  .mobile-menu-visible .sidebar {
    transform: translateX(0);
  }
}

.tools-container, 
.login-container, 
.register-container,
.forgot-container,
.home-page section {
  width: 100%;
  max-width: 100%;
  padding-left: 5%;
  padding-right: 5%;
  box-sizing: border-box;
}

/* 针对不同页面内容的具体响应式布局 */
@media (min-width: 1200px) {
  .tools-container,
  .home-page .hero-section,
  .home-page .features-section,
  .home-page .steps-section {
    padding-left: 10%;
    padding-right: 10%;
  }
}

/* 让卡片布局自适应 */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  width: 100%;
}

/* 让按钮和表单元素自适应 */
.hero-buttons,
.form-container {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
}

/* 内容也使用同样的流体布局理念 */
.page-content {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .page-content {
    padding: 0 40px;
  }
}

@media (min-width: 1200px) {
  .page-content {
    padding: 0 80px;
  }
}

.main-content {
  padding: 24px;
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  background-color: #f0f2f5; /* 浅灰色背景 */
  min-height: calc(100vh - 64px - 50px); /* 减去头部和底部的高度 */
}

/* 身份验证页面调整 */
.login-page, .register-page, .forgot-page {
  padding-top: 40px;
  padding-bottom: 40px;
  min-height: auto; /* 不需要100vh */
  background-color: #f8fafc;
}

.login-container, .register-container, .forgot-container {
  max-width: 1000px;
  margin: 20px auto;
  min-height: auto; /* 不需要固定的最小高度 */
  height: auto;
}

/* 移动设备的特别调整 */
@media (max-width: 992px) {
  .login-container, .register-container, .forgot-container {
    flex-direction: column-reverse;
    max-width: 90%;
  }
}

/* 首页样式调整 */
.home-page {
  background-color: #f8fafc;
}

.hero-section {
  padding: 60px 5%; /* 上下更小的间距 */
  max-width: 1200px;
  margin: 0 auto;
}

.features-section, .steps-section, .faq-section {
  padding: 60px 5%;
  max-width: 1200px;
  margin: 0 auto;
}

.cta-section {
  padding: 60px 5%;
}

/* 工具页面调整 */
.tools-page {
  min-height: auto;
  background-color: #f8fafc;
  padding: 40px 5%;
}

.tools-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* 内容宽度约束 */
.content-wrapper {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* 标题样式统一 */
.page-title {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 2rem;
  font-weight: 600;
  color: #1a202c;
}

/* 副标题样式统一 */
.page-subtitle {
  margin-top: 0;
  margin-bottom: 2rem;
  font-size: 1.1rem;
  color: #718096;
}

/* 通用样式 */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* 按钮样式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: var(--transition-smooth);
  cursor: pointer;
  border: none;
  outline: none;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
}

.btn-secondary {
  background: white;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

/* 卡片样式 */
.card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-base);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* 表单样式 */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-color);
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: var(--radius-base);
  font-size: 14px;
  transition: var(--transition-base);
  background-color: var(--bg-light);
}

.form-input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(19, 194, 194, 0.1);
}

/* 背景装饰 */
.bg-pattern {
  background-image: var(--bg-pattern);
  background-attachment: fixed;
}

.bg-gradient {
  background: var(--primary-gradient);
}

/* 卡片变种 */
.card-glass {
  background-color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-accent {
  border-top: 3px solid var(--accent-color);
}

.card-primary {
  border-top: 3px solid var(--primary-color);
}

.card-secondary {
  border-top: 3px solid var(--secondary-color);
}

/* 图标样式 */
.icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  color: white;
  font-size: 24px;
  margin: 0 auto 20px;
  position: relative;
  z-index: 1;
  box-shadow: 0 5px 15px rgba(19, 194, 194, 0.25);
}

.icon-box::after {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  z-index: -1;
  opacity: 0.3;
  transition: var(--transition-base);
}

.icon-box:hover::after {
  opacity: 0.6;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
}

/* 动画效果 */
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

.slide-up-enter-active,
.slide-up-leave-active {
  transition: all 0.3s ease-out;
}

.slide-up-enter-from {
  opacity: 0;
  transform: translateY(30px);
}

.slide-up-leave-to {
  opacity: 0;
  transform: translateY(-30px);
}

/* 工具类 */
.text-center {
  text-align: center;
}

.text-primary {
  color: var(--primary-color);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-accent {
  color: var(--accent-color);
}

.text-dark {
  color: var(--text-color);
}

.text-muted {
  color: var(--text-secondary);
}

.text-light {
  color: var(--text-light);
}

.bg-primary {
  background-color: var(--primary-color);
}

.bg-secondary {
  background-color: var(--secondary-color);
}

.bg-accent {
  background-color: var(--accent-color);
}

.bg-light {
  background-color: var(--bg-light);
}

.bg-dark {
  background-color: var(--bg-dark);
}

.font-bold {
  font-weight: 700;
}

.font-semibold {
  font-weight: 600;
}

.font-medium {
  font-weight: 500;
}

.font-normal {
  font-weight: 400;
}

.rounded-sm {
  border-radius: var(--radius-sm);
}

.rounded {
  border-radius: var(--radius-base);
}

.rounded-md {
  border-radius: var(--radius-md);
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.rounded-full {
  border-radius: var(--radius-full);
}

.shadow-sm {
  box-shadow: var(--shadow-sm);
}

.shadow {
  box-shadow: var(--shadow-base);
}

.shadow-md {
  box-shadow: var(--shadow-md);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

.mt-1 {
  margin-top: 0.25rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-3 {
  margin-top: 1rem;
}

.mt-4 {
  margin-top: 1.5rem;
}

.mt-5 {
  margin-top: 2rem;
}

.mb-1 {
  margin-bottom: 0.25rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-3 {
  margin-bottom: 1rem;
}

.mb-4 {
  margin-bottom: 1.5rem;
}

.mb-5 {
  margin-bottom: 2rem;
}

.mx-1 {
  margin-left: 0.25rem;
  margin-right: 0.25rem;
}

.mx-2 {
  margin-left: 0.5rem;
  margin-right: 0.5rem;
}

.mx-3 {
  margin-left: 1rem;
  margin-right: 1rem;
}

.mx-4 {
  margin-left: 1.5rem;
  margin-right: 1.5rem;
}

.mx-5 {
  margin-left: 2rem;
  margin-right: 2rem;
}

.my-1 {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

.my-2 {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.my-3 {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.my-4 {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.my-5 {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.p-1 {
  padding: 0.25rem;
}

.p-2 {
  padding: 0.5rem;
}

.p-3 {
  padding: 1rem;
}

.p-4 {
  padding: 1.5rem;
}

.p-5 {
  padding: 2rem;
}

.px-1 {
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.px-2 {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.px-3 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.px-4 {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.px-5 {
  padding-left: 2rem;
  padding-right: 2rem;
}

.py-1 {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.py-3 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.py-4 {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.py-5 {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.flex {
  display: flex;
  gap: 1rem;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1;
}

.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-cols-1 {
  grid-template-columns: repeat(1, 1fr);
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }
.gap-xl { gap: 2rem; }

/* 响应式设计增强 */
@media (max-width: 1200px) {
  .container {
    max-width: 960px;
  }
}

@media (max-width: 992px) {
  .container {
    max-width: 720px;
  }
  
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

@media (max-width: 768px) {
  html, body {
    font-size: 13px;
  }
  
  .container {
    max-width: 540px;
  }
  
  .grid {
    grid-template-columns: 1fr;
  }
  
  .flex {
    flex-direction: column;
  }
  
  .card {
    padding: 1rem;
  }
}

@media (max-width: 576px) {
  .container {
    padding: 0 0.5rem;
  }
  
  .btn {
    width: 100%;
  }
}

/* 暗色模式 */
@media (prefers-color-scheme: dark) {
  :root {
    --text-color: #fff;
    --text-secondary: #ccc;
    --bg-color: #1a1a1a;
    --border-color: #333;
    --bg-light: #2d2d2d;
  }
  
  .card {
    background: #2d2d2d;
  }
  
  .form-input {
    background-color: var(--bg-light);
    border-color: #4a5568;
    color: var(--text-color);
  }
  
  .form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(19, 194, 194, 0.2);
  }
  
  .card-glass {
    background-color: rgba(45, 55, 72, 0.8);
  }
}

/* 图片通用样式优化 */
img {
  max-width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.3s ease;
  object-fit: cover; /* 防止图片变形 */
}

/* 图片加载占位符 */
.img-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-md);
  aspect-ratio: 16/9;
}

.img-container::before {
  content: "";
  display: block;
  padding-top: 75%; /* 默认4:3比例 */
}

.img-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

/* 层级控制 */
:root {
  --z-header: 10;
  --z-dropdown: 20;
  --z-modal: 30;
  --z-tooltip: 40;
}

/* 修复头部波浪与内容层级问题 */
.header-wave {
  z-index: 2 !important;
}

.about-container, .tools-container {
  z-index: 3 !important;
}

/* 修复图片比例和容器问题 */
.hero-image img, .feature-image img, .company-image, .contact-image {
  aspect-ratio: 16/9;
  width: 100%;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.member-avatar img {
  aspect-ratio: 1/1;
  width: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* 统一按钮样式 */
.el-button {
  transition: all 0.3s ease;
}

.el-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(19, 194, 194, 0.2);
}

/* 统一卡片样式 */
.card-shadow {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card-shadow:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-5px);
}

/* 响应式布局优化 */
@media (max-width: 768px) {
  .section-content {
    flex-direction: column;
  }
  
  .hero-section {
    flex-direction: column;
  }
  
  .feature-card, .advantage-card, .team-member {
    margin-bottom: 20px;
  }
}

/* 动画效果 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

.slide-up {
  animation: slideUp 0.3s ease;
}

/* 确保所有元素可以被选择和交互 */
* {
  user-select: auto !important;
  pointer-events: auto !important;
}

/* 防止水印层干扰截图 */
.watermark-layer {
  pointer-events: none;
  opacity: 0.6;
}
